<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<?php
session_start();
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="../Elementos/estilos/ddsmoothmenu3.css" type="text/css" />
        <link rel="stylesheet" href="../Elementos/estilos/ddsmoothmenu-v.css" type="text/css" />
        <script type="text/javascript" src="../Elementos/js/mootools.js"></script>
        <script type="text/javascript" src="../Elementos/js/caption.js"></script>
        <script type="text/javascript" src="../Elementos/js/jquery.min.js"></script>
        <script type="text/javascript" src="../Elementos/js/ddsmoothmenu.js"></script>
        <link rel="stylesheet" href="../Elementos/estilos/main.css" type="text/css" />
        <link rel="stylesheet" href="../Elementos/estilos/main.css" type="text/css" />
        
<script language="javascript">
            //  Developed by Roshan Bhattarai 
            //  Visit http://roshanbh.com.np for this script and more.
            //  This notice MUST stay intact for legal use
    
            $(document).ready(function()
            {
                $("#login_form").submit(function()
                {
                    //remove all the class add the messagebox classes and start fading
                    $("#msgbox").removeClass().addClass('messagebox').text('Validando....').fadeIn(1000);
                    //check the username exists or not from ajax
                    $.post("../Controller/CtrLogin.php?login",{ user_name:$('#username').val(),password:$('#password').val(),rand:Math.random() } ,function(data)
                    {
                       alert(data);
                        var arrayData= data.split("|-|");
                      // alert("-> log"+data);
                        
                        if(arrayData[1]=='ok')
                        {
                            $("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
                            { 
                                //add message and change the class of the box and start fading
                                $(this).html('Logueando.....').addClass('messageboxok').fadeTo(900,1,
                                function()
                                { 
                                    if(arrayData[2]=="1"){
//                                    //redirect to secure page
                                       document.location='FormInicialAdministrador.php';
                                    }else if (arrayData[2]=="2"){
                                        document.location='FormInicialUsuario.php';
                                    }else{
                                        document.location='../View/index.php'; 
                                    }
                                });
                        
                            });
                        }
                        else 
                        {
                            $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
                            { 
                                //add message and change the class of the box and start fading
                                $(this).html('El logueo, fallo... No existe!').addClass('messageboxerror').fadeTo(900,1);
                            });		
                        }
                
                    });
                    return false; //not to post the  form physically
                });
                //now call the ajax also focus move from 
                $("#password").blur(function()
                {
                    $("#login_form").trigger('submit');
                });
            });
        </script>
        <style type="text/css">
            body {
                font-family:Verdana, Arial, Helvetica, sans-serif;
                font-size:11px;
            }
            .top {
                margin-bottom: 15px;
            }
            .buttondiv {
                margin-top: 10px;
            }
            .messagebox{
                position:absolute;
                width:100px;
                margin-left:30px;
                border:1px solid #c93;
                background:#ffc;
                padding:3px;
            }
            .messageboxok{
                position:absolute;
                width:auto;
                margin-left:30px;
                border:1px solid #349534;
                background:#C9FFCA;
                padding:3px;
                font-weight:bold;
                color:#008000;

            }
            .messageboxerror{
                position:absolute;
                width:auto;
                margin-left:30px;
                border:1px solid #CC0000;
                background:#F7CBCA;
                padding:3px;
                font-weight:bold;
                color:#CC0000;
            }

        </style>
    </head>
    <body>

        <div id="wrapper" >
            <div id="header">
                <img src="../Elementos/img/logoUCaldas.jpg" width="1002" height="142">

            </div>

            <div id="navigation">
                <div id="mod_ddsmoothmenu" class="ddsmoothmenu">
                    <ul>
                        <li>
                            <a href="Inicio2.php" style="width: 100 px;text-align: center;font-size:12px;" ><samp>INICIO</samp></a>
                        </li>
                        <li>
                            <a href="InformacionGeneral.php" style="width: 100 px;text-align: center;font-size:12px;" ><samp>INFORMACION GENERAL</samp></a>
                        </li>
                        <li>
                            <a href="Noticias.php" style="width: 100 px;text-align: center;font-size:12px;" ><samp>NOTICIAS</samp></a>
                        </li>
                    </ul>
                    <br style="clear: left">
                </div>

            </div>
            <div id="leftcolumn" >
                <br/>
               
                <img src="../Elementos/img/ucaldas.jpg" width="150" height="150">
                <p><strong> U de Caldas </strong></p>
                <ul>
                    <li>
                        <a href="http://www.ucaldas.edu.co/" style="width: 100 px;text-align: center;font-size:12px;" >
                            <strong> IR A LA U </strong>
                        </a>
                    </li>
                </ul>

            </div>
            <div id="content">
                <div id="contenido">
                        <form method="post" action="" id="login_form">
            <div align="center">
                <div class="top" > <strong style="color:#FF0000">Login</strong></div>
    
                <div >
                    User Name : <input name="username" type="text" id="username" value="" maxlength="20" />
       
                </div>
                <div style="margin-top:5px" >
                    Password :
                    &nbsp;&nbsp;
                    <input name="password" type="password" id="password" value="" maxlength="20" />
        
                </div>
                <div class="buttondiv">
                    <input name="Submit" type="submit" id="submit" value="Login" style="margin-left:-10px; height:23px"  /> <span id="msgbox" style="display:none"></span>
        
                </div>
    
            </div>
        </form>
                </div>


            </div>
            <div id="rightcolumn">
                <p>
                    <br>
                    <br>
                    <a href="http://acad.ucaldas.edu.co/" >
                        <img src="../Elementos/img/registro.jpg" name="Registro Academico" width="140" height="30" border="0" id="Registro Académico">
                        <br>
                    </a>
                    <a href="http://biblioteca.ucaldas.edu.co/" >
                        <img src="../Elementos/img/bibliotecas.jpg" name="Biblioteca" width="140" height="30" border="0" id="Biblioteca">
                        <br>
                    </a>
                    <a href="http://sig.ucaldas.edu.co/acredita/index.php" >
                        <img src="../Elementos/img/acreditacion.jpg" name="Acreditacion" width="140" height="30" border="0" id="Acreditacion">
                        <br>
                    </a>
                    <a href="http://www.ucaldas.edu.co/index.php?option=com_content&view=category&id=391&Itemid=765" >
                        <img src="../Elementos/img/plan.jpg" name="Plan" width="140" height="30" border="0" id="Plan">
                        <br>
                    </a>
                    <a href="http://sig.ucaldas.edu.co/gestionDocumental/index.php" >
                        <img src="../Elementos/img/sig.jpg" name="Sistema" width="140" height="30" border="0" id="Sistema">
                        <br>
                    </a>
                    <a href="http://campusvirtual.ucaldas.edu.co/" >
                        <img src="../Elementos/img/campus.jpg" name="Campus" width="140" height="30" border="0" id="Campus">
                        <br>
                    </a>
                    <a href="http://www.ucaldas.edu.co/index.php?option=com_content&view=category&layout=blog&id=420&Itemid=1017" >
                        <img src="../Elementos/img/contratacion.jpg" name="Contratacion" width="140" height="30" border="0" id="Contratacion">
                        <br>
                    </a>
                    <a href="https://mi.ucaldas.edu.co/sso/module.php/core/loginuserpass.php?AuthState=_6466f706b22750fcd11946cd0b01d470a079f2e91f%3Ahttps%3A%2F%2Fmi.ucaldas.edu.co%2Fsso%2Fsaml2%2Fidp%2FSSOService.php%3Fspentityid%3Dgoogle.com%26cookieTime%3D1340238341%26RelayState%3Dhttps%253A%252F%252Fwww.google.com%252Fa%252Fucaldas.edu.co%252FServiceLogin%253Fservice%253Dmail%2526passive%253Dtrue%2526rm%253Dfalse%2526continue%253Dhttps%25253A%25252F%25252Fmail.google.com%25252Fa%25252Fucaldas.edu.co%25252F%2526ss%253D1%2526ltmpl%253Ddefault%2526ltmplcache%253D2" >
                        <img src="../Elementos/img/correo.jpg" name="Correo" width="140" height="30" border="0" id="Correo">
                        <br>
                    </a>
                    <a href="http://revistascientificas.ucaldas.edu.co/" >
                        <img src="../Elementos/img/revistas.jpg" name="Revis" width="140" height="30" border="0" id="Revis">
                        <br>
                    </a>
                    <a href="Inicio2.php" >
                        <img src="../Elementos/img/cursos1.png" name="cursos" width="140" height="30" border="0" id="Cursos">
                        <br>
                    </a>
                    <a href="http://ucaldas.edu.co/index.php?option=com_content&view=category&layout=blog&id=378&Itemid=1016" >
                        <img src="../Elementos/img/contacto.jpg" name="Contacto" width="140" height="30" border="0" id="Contacto">
                        <br>
                    </a>
                    <a href="http://ucaldas.edu.co/index.php?option=com_content&view=article&id=1698&Itemid=773" >
                        <img src="../Elementos/img/mapa.jpg" name="Map" width="140" height="30" border="0" id="Map">
                        <br>
                    </a>
                </p>
            </div>
            <div id="footer">
                <div align="center" class="Estilo1">
                    "Universidad de Caldas"
                    <br>
                    <samp class="Estilo3">
                        "Sede Principal Calle 65 Nº 26 - 10 / Tel (57) (6) 8781500 Fax 8781501 / Apartado aéreo 275 / E-mail ucaldas@ucaldas.edu.co - Manizales - Caldas - Colombia"
                    </samp>
                </div>

            </div>
        </div>


    </body>
</html>
